<?php
class StatisticsBaiduWidget  extends CWidget{
    
	//输出字符串
	private $baidu = '';
    
    private $controller= '';
    
    private $action= '';

	public function init(){
        $this->controller = Yii::app()->controller->id;  
        $this->action = Yii::app()->controller->action->id; 
	}

	public function run(){
        $this->baiduStatistics();
		echo $this->baidu;
	}
    
    public function baiduStatistics(){
        $this->baidu = <<<BAIDU
<div style='display:none'>
	<script type="text/javascript">
	var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
	document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fe77b2ed83946c2ffcce8c3d2315e010a' type='text/javascript'%3E%3C/script%3E"));
	</script>
</div>
BAIDU;
    }
}


